<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ec" uri="http://www.extcloud.net"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/common/css/layout.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/common/javascript/plugins/autocomplete/css/jquery.autocomplete.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/management/css/list.css" />
<script type="text/javascript"
	src="${pageContext.request.contextPath}/common/javascript/plugins/autocomplete/jquery.autocomplete.js"></script>
<%@include file="/WEB-INF/view/commonJavascriptVar.jsp"%>
<script type="text/javascript">
$(function() {setTimeout("init();",500)});
function init(){
	$().ready(function() {
		$("#keyword").autocomplete(context + "/management/search/equipment/ajaxautocomplete/", {
			minChars : 1,
			matchContains : false,
			matchSubset : 1,
			mustMatch : false,
			multiple : false,
			autoFill : false,
			scroll : false,
			dataType : "json",
			parse : function(data) {
				return $.map(data, function(row) {
					return {
						data : row,
						value : row.name,
						result : row.name + ',' + row.id
					}
				});
			},
			formatItem : function(row, i, max) {
				return '<div class="dropList">' + row.name + '</div>';
			}
		});
		// form
		$("#submit").click(
				function() {
					var s = $("#keyword").val();
					var name = s.split(',')[0];
					var id = s.split(',')[1];
					addItem(name,id);
				}
		);
		$("#clear").click(
				function() {
					$("#keyword").val("");
				}
		);
	});
}
</script>
</head>
<body>
<div id="layoutAll">
<table cellpadding="0" cellspacing="0" width="100%" id="layout_content">
	<tr>
		<td height="100" valign="top">
		<div id="layout_title">
		<h4>请输入物品名称</h4>
		</div>
		<div id="layout_search" style="display: block;">
		<center><input name="keyword" id="keyword" value="${keyword}" />
		<input type="button" id="submit" class="searchButton" value="确    定">
		<input type="button" id="clear" class="searchButton" value="清   空"></center>
		</div>
		<div id="layout_search_pull"></div>
		</td>
	</tr>
</table>
</div>
</body>
</html>